package com.nuesoft.ysu.elm99.controller;

import com.nuesoft.ysu.elm99.entity.Dept;
import com.nuesoft.ysu.elm99.service.IDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/d")
public class DeptController {
    @Autowired
    IDeptService deptService;

    @GetMapping("/q/all")
    public List<Dept> findAll(){
        return deptService.findAll();
    }
}
